<div class="col-md-8">
<div class="main-content" id="main-content">
	<div class="sub-content">
		<div class="top-header page-header clearfix">
			
				<h1>View History</h1>

		</div>
			<?foreach( $history as $key=>$h){?>
			<table class="table table-bordered table-hover" cellpadding="0" cellspacing="0">
				<?if($key==0){?>
				<?if($this->type=='buy'){?>
					<!--<tr>
					<td>Buy Id</td><td>:</td><td><?echo $h->buy_id?></td>
					</tr>-->
					<? if(isset($_SESSION['user']['user_type']) && $_SESSION['user']['user_type']!='user'){?>
						<tr>
							<td>User Name</td><td>:</td><td><?echo $h->company_name?></td>
						</tr>
					<?}?>
					<tr>
						<td>Product Name</td><td>:</td><td><?echo $h->genericname?></td>
					</tr>
					<tr>
						<td>Quantity</td><td>:</td><td><?echo $h->order_for_quantity?></td>
					</tr>
					<tr>
						<td>Actual Price</td><td>:</td><td><?echo $h->order_for_price?></td>
					</tr>
					<tr>
						<td>Note</td><td>:</td><td><?echo $h->updatenote;?></td>
					</tr>
				<?}else{?>
					<!--<tr>
					<td>Bid Id</td><td>:</td><td><?echo $h->bid_id?></td>
					</tr>-->
					<? if(isset($_SESSION['user']['user_type']) && $_SESSION['user']['user_type']!='user'){?>
						<tr>
							<td>User Name</td><td>:</td><td><?echo $h->company_name?></td>
						</tr>
					<?}?>
					<tr>
						<td>Product Name</td><td>:</td><td><?echo $h->genericname?></td>
					</tr>
					<?if($h->biding_quantity!=0){?>
					<tr>
						<td>Quantity</td><td>:</td><td><?echo $h->biding_quantity?></td>
					</tr>
					<?}else{?>
					<tr>
						<td>Quantity</td><td>:</td><td><?echo $h->quntity?></td>
					</tr>
					<?}?>
					<tr>
						<td>Actual Price</td><td>:</td><td><?echo $h->actual_price?></td>
					</tr>
					<tr>
						<td>Biding Price</td><td>:</td><td><?echo $h->biding_price?></td>
					</tr>					
				<?}?>
				
				<?}?>
				<tr>
					<td>Date</td><td>:</td><td><?echo $h->date?></td>
				</tr>
				<tr>
					<?
						$value='';
					if($h->status==0){
						$value='Pending';
					}else if($h->status==1){
						$value='Processing';
					}else if($h->status==2){
						$value='Processed';
					}else if($h->status==3){
						$value='Canceld';
					}
					?>
					<td>Status</td><td>:</td><td><?echo $value;?></td>
				</tr>
				<tr>
				   <td>Note</td><td>:</td><td><?echo $h->updatenote;?></td>
				</tr>
			</table>
			<?}?>
		<div class="spacer20">
			<div class="botton_btns">
				<div class="col-sm-3">&nbsp;</div>
						<div class="col-sm-9">				
					<?if($this->type=='buy'){?>
					<a class="btn btn-danger" role="button" href="<? echo $this->Url('products')?>/view-buy-detailes?product=<? echo $_GET['id'];?>">Back</a>
					<?}else{?>
					<a class="btn btn-danger" role="button" href="<? echo $this->Url('products')?>/view-bid-detailes?product=<? echo $_GET['id'];?>">Back</a>
					<?}?>
				</div>
			</div>
		</div>

	</div>
</div> </div>
